package club.mzywucai.blog.file_system.pojo.vo;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author mzywucai
 * @Description
 * @date 2019/2/13
 */
public class FileBasicListQueryTermsVo implements Serializable {
    private List<Long> fileCategoryList;
    private Integer orderBy = 0; // 不给默认值不注入的时候会出问题
    private Integer pageNum = 0; // 不给默认值不注入的时候会出问题

    // 如果是查询的话：
    private String condition;

    public String getCondition() {
        return condition;
    }

    /**
     * @Description 因为JS中传过来是undefined，所以这里对其做处理：
     *      如果为undefined，则赋值为null；
     *      其他：正常赋值。
     * @author mzywucai
     * @time 2019-02-27
     * @see 
     * @return   void
     * @params  [condition]
     */
    public void setCondition(String condition) {
        this.condition = condition;

        if ("undefined".equals(condition)) {
            this.condition = null;
        }

    }

    public void setFileCategoryList(List<Long> fileCategoryList) {
        this.fileCategoryList = fileCategoryList;
        if (fileCategoryList.size() == 0) {
            this.fileCategoryList = null;
        }
    }

    public void setOrderBy(Integer orderBy) {
        this.orderBy = orderBy;
        /*if (null == orderBy) {
            this.orderBy = 0;
        }*/
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
        /*if (null == pageNum) {
            this.pageNum = 0;
        }*/
    }

    public List<Long> getFileCategoryList() {
        return fileCategoryList;
    }

    public Integer getOrderBy() {
        return orderBy;
    }

    public Integer getPageNum() {
        return pageNum;
    }
}
